package com.ruoyi.ahs.util;

import java.util.Random;

public class RandomIPGenerator {
    public static String generateRandomChineseIP() {
        Random rand = new Random();
        // 中国大陆的 IP 地址范围
        int firstOctet = 10 + rand.nextInt(14); // 10.x.x.x 到 23.x.x.x
        int secondOctet = rand.nextInt(256);
        int thirdOctet = rand.nextInt(256);
        int fourthOctet = rand.nextInt(256);
        
        return String.format("%d.%d.%d.%d", firstOctet, secondOctet, thirdOctet, fourthOctet);
    }

    public static void main(String[] args) {
        System.out.println(generateRandomChineseIP());
    }
}